home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _IELinkClickByText.au3 < prev    next >
Text File  |  2007-09-08  |  911b  |  27 lines

  1. ; *******************************************************
  2. ; Example 1 - Open browser with basic example, click on the    link
  3. ;                with text "user forum"
  4. ; *******************************************************
  5. ;
  6. #include <IE.au3>
  7. $oIE = _IE_Example ("basic")
  8. _IELinkClickByText ($oIE, "user forum")
  9.  
  10. ; *******************************************************
  11. ; Example 2 - Open browser to the AutoIt homepage, loop through the links
  12. ;                on the page and click on the link with text "wallpaper" 
  13. ;                using a sub-string match. 
  14. ; *******************************************************
  15. ;
  16. #include <IE.au3>
  17. $oIE = _IECreate("http://www.autoitscript.com")
  18.  
  19. $sMyString = "wallpaper"
  20. $oLinks = _IELinkGetCollection($oIE)
  21. For $oLink in $oLinks
  22.     $sLinkText = _IEPropertyGet($oLink, "innerText")
  23.     If StringInStr($sLinkText, $sMyString) Then
  24.         _IEAction($oLink, "click")
  25.         ExitLoop
  26.     EndIf
  27. Next